<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts: lib/timetests.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">ESP8266ILI9341DisplayProject</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">timetests.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="timetests_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#ifdef ESP8266</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="user__config_8h.html">user_config.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fatfs_8h.html">fatfs.h</a>&quot;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="mathio_8h.html">printf/mathio.h</a>&quot;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="time_8h.html">lib/time.h</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="timer_8h.html">lib/timer.h</a>&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#ifdef RTC_SUPPORT</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;lib/rtc.h&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="time_8h.html">time.h</a>&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">   43</a></span>&#160;<span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">__seed</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="timetests_8c.html#ae3c957237ef10b1dd9d634b6d3ddb0b0">   46</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="timetests_8c.html#ae3c957237ef10b1dd9d634b6d3ddb0b0">mysrand</a>(<span class="keywordtype">int</span> seed)</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <a class="code" href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">__seed</a> = seed;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;}</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">   52</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(<span class="keywordtype">int</span> start, <span class="keywordtype">int</span> end)</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordtype">long</span> k,s;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordtype">int</span> val;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">double</span> fval,begin,span;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">if</span>(end &gt; start)</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    {</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        begin = (double) start; </div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        span = (double) (end - start);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        span = (double) (start - end);</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        begin = (double) end;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    }</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    s = (long)<a class="code" href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">__seed</a>;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordflow">if</span> (s == 0)</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        s = 0x31415926<a class="code" href="cal__dex_8c.html#a7577d49f3bfffb1cf048eef843177784">L</a>;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    k = s / 127773;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    s = 16807 * (s - k * 127773) - 2836 * k;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordflow">if</span> (s &lt; 0)</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        s += 2147483647UL;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <a class="code" href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">__seed</a> = (<span class="keywordtype">unsigned</span> int)s;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="comment">// force s into 0 .. 0x7fffffffUL positive </span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    s &amp;= 0x7fffffffUL;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    fval = (double) s / (<span class="keywordtype">double</span>) 0x7fffffff<a class="code" href="cal__dex_8c.html#a7577d49f3bfffb1cf048eef843177784">L</a>;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    fval *= (double) span;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    fval += (double) begin;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">//printf(&quot;fval: %f, span:%f, begin:%f\n&quot;, (double)fval, (double)span, (double)begin);</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    val = fval;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">return</span>(val);</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;}</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<a class="code" href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="timetests_8c.html#ae7aeedba022f6bb6d51510e55c95c4fa">   99</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="timetests_8c.html#ae7aeedba022f6bb6d51510e55c95c4fa">timetests</a>(<span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> check)</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;{</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="struct____file.html">FILE</a> *fp;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <a class="code" href="time_8h.html#a3346b04b0420b32ccf6b706551b70762">time_t</a> epoch;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="structtm.html">tm_t</a> <a class="code" href="structtm.html">tm</a>;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="structtimeval.html">tv_t</a> tv;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <a class="code" href="structtimezone.html">tz_t</a> tz;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">int</span> i;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordtype">int</span> val;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordtype">char</span> buf[64];</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    str = <a class="code" href="stringsup_8c.html#a8cebaf955a9e3b5f1f2af105641dad40">skipspaces</a>(str);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">if</span>(!*str)</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        fp = <a class="code" href="posix_8h.html#a0c0ef221f95f64e8632451312fd18cc8">stdout</a>;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(check)</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        fp = <a class="code" href="posix_8c.html#a8e661c338f41695d1a1e70aed6255e2d">fopen</a>(str,<span class="stringliteral">&quot;rb&quot;</span>);</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        fp = <a class="code" href="posix_8c.html#a8e661c338f41695d1a1e70aed6255e2d">fopen</a>(str,<span class="stringliteral">&quot;wb&quot;</span>);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordflow">if</span>(fp == <a class="code" href="cpu_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>)</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <a class="code" href="posix_8c.html#a4ce26afbb10890d31c53a8ff76d992e3">perror</a>(<span class="stringliteral">&quot;timetest file open failed&quot;</span>);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <a class="code" href="time_8c.html#a96a115b6a8104959a7340938f150a350">gettimeofday</a>(&amp;tv, &amp;tz);</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    <a class="code" href="timetests_8c.html#ae3c957237ef10b1dd9d634b6d3ddb0b0">mysrand</a>(tv.<a class="code" href="structtimeval.html#aef6ddab1064c430758f9f913b7e4a21e">tv_sec</a>);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">//    struct tm {</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">//     int tm_sec;    /* Seconds (0-60) */</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">//     int tm_min;    /* Minutes (0-59) */</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">//     int tm_hour;   /* Hours (0-23) */</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="comment">//     int tm_mday;   /* Day of the month (1-31) */</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="comment">//     int tm_mon;    /* Month (0-11) */</span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="comment">//     int tm_year;   /* Year - 1900 */</span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="comment">//     int tm_wday;   /* Day of the week (0-6, Sunday = 0) */</span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">//     int tm_yday;   /* Day in the year (0-365, 1 Jan = 0) */</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="comment">//     int tm_isdst;  /* Daylight saving time */</span></div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment">//    };</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordflow">for</span>(i=0;i&lt;20;++i)</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    {</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="preprocessor">#ifdef ESP8266</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <a class="code" href="user__task_8c.html#a863d8bc03e69f2efee6042bcec7b456b">optimistic_yield</a>(1000);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <span class="keywordflow">if</span>(!check)</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            tm.<a class="code" href="structtm.html#a33adf78fd6476b2120ce3b9c4a852053">tm_year</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(<a class="code" href="time_8h.html#aa0e47af385cda59b56c1ba71dee795d8">EPOCH_YEAR</a>+2,2099) - 1900;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            tm.<a class="code" href="structtm.html#a112ac36fa2f593777138a417cf031e17">tm_mon</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(-18,18);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            tm.<a class="code" href="structtm.html#ab8d8904bad43b0c8b96e61941c5b5310">tm_mday</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(-45,45);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            tm.<a class="code" href="structtm.html#a3e7ca4e37f1abcaf56b8a916c38eb9fe">tm_hour</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(-36,36);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            tm.<a class="code" href="structtm.html#af414eb7c86cc3099595211eee4d4211b">tm_min</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(-90,90);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            tm.<a class="code" href="structtm.html#a4d098a9a5c03a00b2ee61e10851de81e">tm_sec</a> = <a class="code" href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a>(-90,90);</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;test: %d\n&quot;</span>, i);</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;%4d,%2d,%2d, %02d:%02d:%2d\n&quot;</span>, </div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a33adf78fd6476b2120ce3b9c4a852053">tm_year</a>+1900, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a112ac36fa2f593777138a417cf031e17">tm_mon</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#ab8d8904bad43b0c8b96e61941c5b5310">tm_mday</a>, </div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a3e7ca4e37f1abcaf56b8a916c38eb9fe">tm_hour</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#af414eb7c86cc3099595211eee4d4211b">tm_min</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a4d098a9a5c03a00b2ee61e10851de81e">tm_sec</a>);</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;            <span class="comment">// express val as local time</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            epoch = <a class="code" href="time_8c.html#aeafbe7f942ef85f85edbbe31e439372b">mktime</a>(&amp;tm);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;%10lu, %s\n&quot;</span>, (<span class="keywordtype">long</span>) epoch, <a class="code" href="time_8c.html#a7ffc52def0c7fbf70c50248e3f7d6a8a">asctime_r</a>(&amp;tm, buf));</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;%4d,%2d,%2d, %02d:%02d:%2d\n&quot;</span>, </div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a33adf78fd6476b2120ce3b9c4a852053">tm_year</a>+1900, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a112ac36fa2f593777138a417cf031e17">tm_mon</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#ab8d8904bad43b0c8b96e61941c5b5310">tm_mday</a>, </div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a3e7ca4e37f1abcaf56b8a916c38eb9fe">tm_hour</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#af414eb7c86cc3099595211eee4d4211b">tm_min</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a4d098a9a5c03a00b2ee61e10851de81e">tm_sec</a>);</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            <a class="code" href="time_8c.html#af05576742e2f8ad3924c02a6af70a86d">localtime_r</a>(&amp;epoch, &amp;tm);</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;%10lu, %s\n&quot;</span>, (<span class="keywordtype">long</span>) epoch, <a class="code" href="time_8c.html#a7ffc52def0c7fbf70c50248e3f7d6a8a">asctime_r</a>(&amp;tm, buf));</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;%4d,%2d,%2d, %02d:%02d:%2d\n&quot;</span>, </div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a33adf78fd6476b2120ce3b9c4a852053">tm_year</a>+1900, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a112ac36fa2f593777138a417cf031e17">tm_mon</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#ab8d8904bad43b0c8b96e61941c5b5310">tm_mday</a>, </div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;                (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a3e7ca4e37f1abcaf56b8a916c38eb9fe">tm_hour</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#af414eb7c86cc3099595211eee4d4211b">tm_min</a>, (<span class="keywordtype">int</span>)tm.<a class="code" href="structtm.html#a4d098a9a5c03a00b2ee61e10851de81e">tm_sec</a>);</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;            <a class="code" href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a>(fp,<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        }</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    }</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    <a class="code" href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a>(<span class="stringliteral">&quot;-1 = %d\n&quot;</span>, -1);</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keywordflow">if</span> (fp != <a class="code" href="posix_8h.html#a0c0ef221f95f64e8632451312fd18cc8">stdout</a> )</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        <span class="keywordflow">if</span>( <a class="code" href="posix_8c.html#ad6fd240fec1d65213f34b6e6465a8033">fclose</a>(fp) )</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;            <a class="code" href="posix_8c.html#a4ce26afbb10890d31c53a8ff76d992e3">perror</a>(<span class="stringliteral">&quot;timetest fclose failed&quot;</span>);</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="keywordflow">return</span>(1);</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;}</div><div class="ttc" id="structtm_html_af414eb7c86cc3099595211eee4d4211b"><div class="ttname"><a href="structtm.html#af414eb7c86cc3099595211eee4d4211b">tm::tm_min</a></div><div class="ttdeci">int tm_min</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00044">time.h:44</a></div></div>
<div class="ttc" id="time_8c_html_a7ffc52def0c7fbf70c50248e3f7d6a8a"><div class="ttname"><a href="time_8c.html#a7ffc52def0c7fbf70c50248e3f7d6a8a">asctime_r</a></div><div class="ttdeci">MEMSPACE char * asctime_r(tm_t *t, char *buf)</div><div class="ttdoc">Convert tm_t *t structure into POSIX asctime() ASCII string *buf. </div><div class="ttdef"><b>Definition:</b> <a href="time_8c_source.html#l00367">time.c:367</a></div></div>
<div class="ttc" id="time_8c_html_aeafbe7f942ef85f85edbbe31e439372b"><div class="ttname"><a href="time_8c.html#aeafbe7f942ef85f85edbbe31e439372b">mktime</a></div><div class="ttdeci">MEMSPACE time_t mktime(tm_t *t)</div><div class="ttdoc">convert tm_t structure to time_t local time epoch </div><div class="ttdef"><b>Definition:</b> <a href="time_8c_source.html#l00534">time.c:534</a></div></div>
<div class="ttc" id="user__config_8h_html"><div class="ttname"><a href="user__config_8h.html">user_config.h</a></div><div class="ttdoc">Master include file for project Includes all project includes and defines here. </div></div>
<div class="ttc" id="time_8h_html"><div class="ttname"><a href="time_8h.html">time.h</a></div><div class="ttdoc">Common Linux/POSIX time functions. </div></div>
<div class="ttc" id="structtm_html_ab8d8904bad43b0c8b96e61941c5b5310"><div class="ttname"><a href="structtm.html#ab8d8904bad43b0c8b96e61941c5b5310">tm::tm_mday</a></div><div class="ttdeci">int tm_mday</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00046">time.h:46</a></div></div>
<div class="ttc" id="posix_8c_html_a8e661c338f41695d1a1e70aed6255e2d"><div class="ttname"><a href="posix_8c.html#a8e661c338f41695d1a1e70aed6255e2d">fopen</a></div><div class="ttdeci">MEMSPACE FILE * fopen(const char *path, const char *mode)</div><div class="ttdoc">POSIX Open a file with path name and ascii file mode string. </div><div class="ttdef"><b>Definition:</b> <a href="posix_8c_source.html#l00782">posix.c:782</a></div></div>
<div class="ttc" id="timetests_8c_html_ae3c957237ef10b1dd9d634b6d3ddb0b0"><div class="ttname"><a href="timetests_8c.html#ae3c957237ef10b1dd9d634b6d3ddb0b0">mysrand</a></div><div class="ttdeci">MEMSPACE void mysrand(int seed)</div><div class="ttdef"><b>Definition:</b> <a href="timetests_8c_source.html#l00046">timetests.c:46</a></div></div>
<div class="ttc" id="structtm_html_a33adf78fd6476b2120ce3b9c4a852053"><div class="ttname"><a href="structtm.html#a33adf78fd6476b2120ce3b9c4a852053">tm::tm_year</a></div><div class="ttdeci">int tm_year</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00048">time.h:48</a></div></div>
<div class="ttc" id="posix_8c_html_a4ce26afbb10890d31c53a8ff76d992e3"><div class="ttname"><a href="posix_8c.html#a4ce26afbb10890d31c53a8ff76d992e3">perror</a></div><div class="ttdeci">MEMSPACE void perror(const char *s)</div><div class="ttdoc">POSIX perror() - convert POSIX errno to text with user message. </div><div class="ttdef"><b>Definition:</b> <a href="posix_8c_source.html#l01814">posix.c:1814</a></div></div>
<div class="ttc" id="struct____file_html"><div class="ttname"><a href="struct____file.html">__file</a></div><div class="ttdoc">FILE type structure. </div><div class="ttdef"><b>Definition:</b> <a href="posix_8h_source.html#l00156">posix.h:156</a></div></div>
<div class="ttc" id="structtimeval_html_aef6ddab1064c430758f9f913b7e4a21e"><div class="ttname"><a href="structtimeval.html#aef6ddab1064c430758f9f913b7e4a21e">timeval::tv_sec</a></div><div class="ttdeci">time_t tv_sec</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00070">time.h:70</a></div></div>
<div class="ttc" id="posix_8c_html_a91ade11061b9b43b1edd37ff32f76591"><div class="ttname"><a href="posix_8c.html#a91ade11061b9b43b1edd37ff32f76591">fprintf</a></div><div class="ttdeci">MEMSPACE int fprintf(FILE *fp, const char *format,...)</div><div class="ttdoc">fprintf function Example user defined printf function using fputc for I/O This method allows I/O to d...</div><div class="ttdef"><b>Definition:</b> <a href="posix_8c_source.html#l02484">posix.c:2484</a></div></div>
<div class="ttc" id="timer_8h_html"><div class="ttname"><a href="timer_8h.html">timer.h</a></div><div class="ttdoc">timer functions </div></div>
<div class="ttc" id="user__task_8c_html_a863d8bc03e69f2efee6042bcec7b456b"><div class="ttname"><a href="user__task_8c.html#a863d8bc03e69f2efee6042bcec7b456b">optimistic_yield</a></div><div class="ttdeci">void optimistic_yield(uint32_t interval_us)</div><div class="ttdef"><b>Definition:</b> <a href="user__task_8c_source.html#l00102">user_task.c:102</a></div></div>
<div class="ttc" id="time_8h_html_a3346b04b0420b32ccf6b706551b70762"><div class="ttname"><a href="time_8h.html#a3346b04b0420b32ccf6b706551b70762">time_t</a></div><div class="ttdeci">uint32_t time_t</div><div class="ttdoc">type of EPOCH result. </div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00035">time.h:35</a></div></div>
<div class="ttc" id="structtm_html_a112ac36fa2f593777138a417cf031e17"><div class="ttname"><a href="structtm.html#a112ac36fa2f593777138a417cf031e17">tm::tm_mon</a></div><div class="ttdeci">int tm_mon</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00047">time.h:47</a></div></div>
<div class="ttc" id="cpu_8h_html_a070d2ce7b6bb7e5c05602aa8c308d0c4"><div class="ttname"><a href="cpu_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></div><div class="ttdeci">#define NULL</div><div class="ttdef"><b>Definition:</b> <a href="cpu_8h_source.html#l00055">cpu.h:55</a></div></div>
<div class="ttc" id="timetests_8c_html_a7e4ffe70d2c17f34cdfaa168392c4970"><div class="ttname"><a href="timetests_8c.html#a7e4ffe70d2c17f34cdfaa168392c4970">__seed</a></div><div class="ttdeci">static unsigned int __seed</div><div class="ttdef"><b>Definition:</b> <a href="timetests_8c_source.html#l00043">timetests.c:43</a></div></div>
<div class="ttc" id="structtimeval_html"><div class="ttname"><a href="structtimeval.html">timeval</a></div><div class="ttdoc">POSIX timeval. </div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00068">time.h:68</a></div></div>
<div class="ttc" id="timetests_8c_html_a66b9965f3aebbd59ff4d3a6c9ca0040e"><div class="ttname"><a href="timetests_8c.html#a66b9965f3aebbd59ff4d3a6c9ca0040e">myrand</a></div><div class="ttdeci">MEMSPACE int myrand(int start, int end)</div><div class="ttdef"><b>Definition:</b> <a href="timetests_8c_source.html#l00052">timetests.c:52</a></div></div>
<div class="ttc" id="mathio_8h_html"><div class="ttname"><a href="mathio_8h.html">mathio.h</a></div><div class="ttdoc">Math IO functions, and verious conversion code with floating point support. </div></div>
<div class="ttc" id="timetests_8c_html_ae7aeedba022f6bb6d51510e55c95c4fa"><div class="ttname"><a href="timetests_8c.html#ae7aeedba022f6bb6d51510e55c95c4fa">timetests</a></div><div class="ttdeci">MEMSPACE int timetests(char *str, int check)</div><div class="ttdef"><b>Definition:</b> <a href="timetests_8c_source.html#l00099">timetests.c:99</a></div></div>
<div class="ttc" id="posix_8c_html_ad6fd240fec1d65213f34b6e6465a8033"><div class="ttname"><a href="posix_8c.html#ad6fd240fec1d65213f34b6e6465a8033">fclose</a></div><div class="ttdeci">MEMSPACE int fclose(FILE *stream)</div><div class="ttdoc">POSIX close a file stream. </div><div class="ttdef"><b>Definition:</b> <a href="posix_8c_source.html#l01239">posix.c:1239</a></div></div>
<div class="ttc" id="time_8h_html_aa0e47af385cda59b56c1ba71dee795d8"><div class="ttname"><a href="time_8h.html#aa0e47af385cda59b56c1ba71dee795d8">EPOCH_YEAR</a></div><div class="ttdeci">#define EPOCH_YEAR</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00029">time.h:29</a></div></div>
<div class="ttc" id="structtm_html"><div class="ttname"><a href="structtm.html">tm</a></div><div class="ttdoc">POSIX struct tm. </div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00041">time.h:41</a></div></div>
<div class="ttc" id="posix_8h_html_a0c0ef221f95f64e8632451312fd18cc8"><div class="ttname"><a href="posix_8h.html#a0c0ef221f95f64e8632451312fd18cc8">stdout</a></div><div class="ttdeci">#define stdout</div><div class="ttdef"><b>Definition:</b> <a href="posix_8h_source.html#l00270">posix.h:270</a></div></div>
<div class="ttc" id="cpu_8h_html_ad0fe97585b8891f5e4f2b9a6426330a4"><div class="ttname"><a href="cpu_8h.html#ad0fe97585b8891f5e4f2b9a6426330a4">MEMSPACE</a></div><div class="ttdeci">#define MEMSPACE</div><div class="ttdef"><b>Definition:</b> <a href="cpu_8h_source.html#l00025">cpu.h:25</a></div></div>
<div class="ttc" id="time_8c_html_a96a115b6a8104959a7340938f150a350"><div class="ttname"><a href="time_8c.html#a96a115b6a8104959a7340938f150a350">gettimeofday</a></div><div class="ttdeci">MEMSPACE int gettimeofday(tv_t *tv, tz_t *tz)</div><div class="ttdoc">Get current time struct timeval *tv and struct timezone *tz - POSIX function. We assume a GMT hardwar...</div><div class="ttdef"><b>Definition:</b> <a href="time_8c_source.html#l00822">time.c:822</a></div></div>
<div class="ttc" id="mathio_8h_html_ad6078f8da2d30ecaef99e0c2d250c0c8"><div class="ttname"><a href="mathio_8h.html#ad6078f8da2d30ecaef99e0c2d250c0c8">printf</a></div><div class="ttdeci">MEMSPACE int printf(const char *format,...)</div></div>
<div class="ttc" id="time_8c_html_af05576742e2f8ad3924c02a6af70a86d"><div class="ttname"><a href="time_8c.html#af05576742e2f8ad3924c02a6af70a86d">localtime_r</a></div><div class="ttdeci">MEMSPACE tm_t * localtime_r(time_t *t, tm_t *result)</div><div class="ttdoc">Convert POSIX epoch time_t *tp into POSIX tm_t *result expressed as local time using timezone and DST...</div><div class="ttdef"><b>Definition:</b> <a href="time_8c_source.html#l00499">time.c:499</a></div></div>
<div class="ttc" id="cal__dex_8c_html_a7577d49f3bfffb1cf048eef843177784"><div class="ttname"><a href="cal__dex_8c.html#a7577d49f3bfffb1cf048eef843177784">L</a></div><div class="ttdeci">#define L(x)</div><div class="ttdef"><b>Definition:</b> <a href="cal__dex_8c_source.html#l00054">cal_dex.c:54</a></div></div>
<div class="ttc" id="structtm_html_a4d098a9a5c03a00b2ee61e10851de81e"><div class="ttname"><a href="structtm.html#a4d098a9a5c03a00b2ee61e10851de81e">tm::tm_sec</a></div><div class="ttdeci">int tm_sec</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00043">time.h:43</a></div></div>
<div class="ttc" id="structtm_html_a3e7ca4e37f1abcaf56b8a916c38eb9fe"><div class="ttname"><a href="structtm.html#a3e7ca4e37f1abcaf56b8a916c38eb9fe">tm::tm_hour</a></div><div class="ttdeci">int tm_hour</div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00045">time.h:45</a></div></div>
<div class="ttc" id="structtimezone_html"><div class="ttname"><a href="structtimezone.html">timezone</a></div><div class="ttdoc">POSIX timezone. </div><div class="ttdef"><b>Definition:</b> <a href="time_8h_source.html#l00078">time.h:78</a></div></div>
<div class="ttc" id="fatfs_8h_html"><div class="ttname"><a href="fatfs_8h.html">fatfs.h</a></div></div>
<div class="ttc" id="stringsup_8c_html_a8cebaf955a9e3b5f1f2af105641dad40"><div class="ttname"><a href="stringsup_8c.html#a8cebaf955a9e3b5f1f2af105641dad40">skipspaces</a></div><div class="ttdeci">MEMSPACE char * skipspaces(char *ptr)</div><div class="ttdoc">Skip white space in a string - tabs and spaces. </div><div class="ttdef"><b>Definition:</b> <a href="stringsup_8c_source.html#l00289">stringsup.c:289</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 31 2018 21:22:16 for ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
